1 /******************************************************************************* 2 * Copyright (c) 2000, 2008 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 *******************************************************************************/ 14 package org.eclipse.swt.custom; 15 16 import org.eclipse.swt.events.*; 17 18 /** 19 * This event is sent when a new offset is required based on the current 20 * offset and a movement type. 21 * 22 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> 23 * 24 * @since 3.3 25 */ 26 public class MovementEvent extends TypedEvent { 27 28 /** 29 * line start offset (input) 30 */ 31 public int lineOffset; 32 33 /** 34 * line text (input) 35 */ 36 public String lineText; 37 38 /** 39 * the current offset (input) 40 */ 41 public int offset; 42 43 /** 44 * the new offset (input, output) 45 */ 46 public int newOffset; 47 48 /** 49 * the movement type (input) 50 * 51 * @see org.eclipse.swt.SWT#MOVEMENT_WORD 52 * @see org.eclipse.swt.SWT#MOVEMENT_WORD_END 53 * @see org.eclipse.swt.SWT#MOVEMENT_WORD_START 54 * @see org.eclipse.swt.SWT#MOVEMENT_CHAR 55 * @see org.eclipse.swt.SWT#MOVEMENT_CLUSTER 56 */ 57 public int movement; 58 59 static final long serialVersionUID = 3978765487853324342L; 60 61 /** 62 * Constructs a new instance of this class based on the 63 * information in the given event. 64 * 65 * @param e the event containing the information 66 */ MovementEvent(StyledTextEvent e)67public MovementEvent(StyledTextEvent e) { 68 super(e); 69 lineOffset = e.detail; 70 lineText = e.text; 71 movement = e.count; 72 offset = e.start; 73 newOffset = e.end; 74 } 75 } 76 77 78